﻿using System.Reflection;

namespace JIESHINet.Common.Helper
{
    public static class MethodInfoHelper
    {
        /// <summary>
        /// 用于返回给定MethodInfo对象的完整名称。
        /// </summary>
        /// <param name="method"></param>
        /// <returns></returns>
        public static string GetFullName(this MethodInfo method)
        {
            if (method.DeclaringType == null)
            {
                return $@"{method.Name}";
            }

            return $"{method.DeclaringType.FullName}.{method.Name}";
        }
    }
}
